Rewrite from scratch with nice architecture