(insert witty title to do with removing nearly repeated code here)