cleaned up the code and file structure a bit