Refactoring; preparing client-side framework