Code cleaned up a little