Alexey's refactoring after first iteraton