cleanup and rewrite

^ that :)