implemented the keys storage
cleanup