refactor to Google coding standards (almost)