comments and code cleanup