refactor: extract prefix strip to helper