some refactoring, adding Robot class, exception class, separate conversions