trim some unneeded bits