More function flatening