added design for a complete rewrite