Add leave dao and refactor other