Clean up, add mode switch (untested, YOLO)