Backup: Rewrite logic, pretty-fy