core: refactor attribute storage
core: improve 'if' detection with 'return' instruction