refactor sendResponseMethod