Small bugfix (does not crash if plate is almost out of sight) + some refactoring