more refactoring
strip padding