Remove unecessary function and fix hash generation function.