Addressed todos, could do more refactoring

Random stuff.