//Helper functions to refactor the init