Invalid Command Exception + some refactoring

introduced some constants