Refactored for new codec project