page_handler alternative 1.12+

While upgrading plugins to 1.12 from 1.8, I came across the issue where "page_handler" is removed from 1.12. Is there any good alternative for this method available in Elgg at the moment? Currently I've replaced it with something that uses internal Elgg methods:

          // Get all registered page handelers
            $handlers = _elgg_services()->router->getPageHandlers();

            // Check if the page handlers exists
            if (isset($handlers['{identifier}'])) {

                // Get handler function
                $handler = $handlers['{identifier}'];

                // Execute the page handler
                $handled = call_user_func($handler, array(
                    {url parts}
                ), '{indentifier}');

                // Check if it succeeds
                if (!$handled) {
                    // some (custom) error handling going on here..
                }
            } else {
                // some (custom) error handling going on here..
            }