refactor string trimming
ignore unused code