Refactoring to allow easy creation of InputComponents