organize structure

put method functions to a single file and move frame codes out of child
directory.