Some quick refactoring

Just cleaning this up a bit