comments and code reordering to have a more clear structure inside the file