adding refactor plus old viewport changes