refactoring / code cleanup
more code cleanup
web version of truncation