Component-based architecture added, needs major cleanup and optimization