Refactor realize, on_realize, add and on_added methods (improve organization)