public void start() {
        CommandFactory commands = new CommandFactory(citationStorage, io);

        io.println("Welcome to \"Citation Needed\"!");
        io.println("Available commands: " + commands + ", quit");

        while (true) {
            String commandStr = io.getString("> ");
            commandStr = commandStr == null ? null : commandStr.trim();
            String[] commandArray = commandStr == null ? null : commandStr.split(" ");

            if (commandArray != null && commandArray[0].equalsIgnoreCase("quit")) {
                break;
            }

            Command command = commandArray == null ? null : commands.getCommand(commandArray[0]);
            if (command == null) {
                io.println("Unknown command! Available commands: " + commands + ", quit");
                continue;
            }

            if (commandArray.length > 1) {
                command.run(Arrays.copyOfRange(commandArray, 1, commandArray.length));
            } else {
                command.run();
            }
        }
    }