Refactored to use type alias instead of traits for function objects