code refactoring, bug fixing.