refactored, added restless dependencies etc