Create a localExecute method and cleanup error handling.

This allows for better and more consistent error handling.