remove unnecessary bits and fix whitespace issues