fix rubocop errors and replace 1 with the 'x' char for improved logic