clean up and refactor
init