refactor code
update .gitignore
refactor code
enhance error handling