moved file hash calculation to own method