error handling, method extraction