refactors code for organization page