Move init functions to common file, fixing gentoo