Macros on chip operations
Some refactor