changes to make functions "by-friendly"