Throw exception in Application::getModule when module not found. Code cleanup