refactored requiredProperty and added tests