improve trailing whitespace detection, shortcut for remove them