Refactor shared components