refactor main into layers