refactoring timepicker