reformatted header comments, removed unneded ifdefs, moved cleanups