refactored builtins handling