Cleaned up whole framework