refactored code according to new dir structure