ARP: a bit of refactoring, should also fix #101