Method cleanup and fixed some error handling