Refactor method name parsing