Improve getViewKeys splits; create unit test for the method