bugs fixed and refactoring