second attempt to abstract