Refactor, cleanup