More versatile code