restructure functions
clean up unnecessary files