moar refactor (master)