fun and call clauses. the latter is a huge mess, should refactor