refactor main project