renaming functions file to something more generic; adding a success/failure counter abstraction