minimize custom code to improve backward compatibility