Refactor, clean up a little