refactor view driven functionality