Refactor checksum