modularized init, init functions now moved to its own file