simplified the framework structure and did some code cleanups