Replace hash function and add some options