Implement main context initialization