Moved control creation to own function