Refactor creation of input and label