cleanup files and refactor packages