Code refactored, new prototype design