a lot of bug fixing and refactoring are done