fixing tests and rubocop and delete method