refactor, ready to jquery