refactoring
bug fixes