constants
some refactorings
hashing
error handling