Refactoring code (using ko's subscribe methods instead of Jquery events)