section 2.2 refactored