refactored byte/string conversion API