splits into smaller, more understandable methods