refactor without jquery ui