moved all comon operations to a helper class