Refactored organization code and added new update organizations command