created method for handling page functions for each path