Some quick refactoring.