extracted functionality from fileController and moved to seperate reuseable classes. Closes #21