fix file requirements
use datastore
refactoring