refactoring of groups and pages functions in own files