cleaned up version mess
removed unused import
better check for interfaces, support set encoding