Code clean-up/refactoring