Refactoring and add a simple docs