Changed architecture for better extensibility