refactoring all issues. Need review