refactor knockout js