Add trim method, refactor private fns to drop _ prefix, minor tweaks