Refactoring code, extracting 4008 chip