common logic factory