refeactored parse and validate to be separate methods