Improve organization of functionality