Cleanup (refactor, whitespace, comments, etc.)