refactored tryExpression