Refactor handling of active parts