Major refactor of init