Refactoring to support user controls