transcoder functions refactored.