Refactor and cleanup the project