working version before refactoring structure