refactored the pure logic frame
first demoable version