knockout setup and refactorings