Cleaning up unused classes and files, fixing small bugs