Improved the class architecture.