[Apache] Clean up main, use modern features