update method in membership controller refactored