refactored controls to be handled by jquery