remove unnecessary spaces.