Fixed some todos, cleaned up the codebase