common script for separating