Refactor, code clean-up