Better way of getting prop variable value