move some code to module

and add some description to ReadMe