Replace falafel with internal logic