add basic README
refactoring for better reusability