Refactor entry point