javasctipt folder and functional interface patern