improve automatic method generator