fixing issues
refactoring