reorganized the functions directory structure