Move redundant startup code in to separate module