Updated framework to latest version. some minor optimizations