Refactore hubs class and application class