Better function abstraction