better code for previous commit