Move complex scopes content into class method
Add comments.