Just some more refactoring needed, but good to go