refactor the getRequiredProps method