Refactored replacement attorney code