Refactorization in checkio.cpp