Made database write neater.