Some comments and code cleanup