Removed debugger requirements and tidied up code