some improvement
refactor to module
making more fixes