refactored entry point main class