Improve common logic