create submodule function and cleanup temp buffer.
Merge pull request #3 from mhayashi1120/cleanup-temp-buffer

create submodule function and cleanup temp buffer.