Redesigned code