Refactored truncation API to be extensible