post rubocop and refactored