Refactored entry point.