Finalize project and refactor code