debt added
big refactoring