Code refactoring for Tiny4 Behavior