Collapse variables of same types into single declaration, fix some formatting.