move code for snapshot name generation to more appropriate place