cleanup to follow a more strict C standard