Re-architect the code