finalize structure

general refactoring