Refactored lots of code / deleted unused classes