move out setup related code into own file