validation and style cleanup