refactored coefficient coder