Refactor callback to use node js (err, value) conventions