more rewrites, less bugs