bug fixing and refactor
refactor
minor updates