refactored several locks in Avatar related modules
refactored EmailModule