Fixes editor in tests and cleans up code