Refactoring to prepare for more changes