Fixed method not found bug. Updated methods

I updated a method to use the prefered way to to callbacks, with nested
functions. I also fixed a bug on a code path that is not normally hit.
Updated remote_newbuild to nested functions