Groups code and fixes header