cleaning quarry's source and fix entity bug