UTf-8 support, performance improvements and generic clean up