Improved fragment code.