Refactor

@BradleyJennings you might want to push up your stuff before this goes in, there will be conflicts