refactored functions and linked filestore file