Some cleanup and style improvements