add const correctness and remove leading trailing method for strings