reorganization for easier comprehension