moving files and functions to cope with dependency and flexibility