changed data structure
refactoring