Refactor page behaviour into own model