Refactor and remove old classes