reorganizing so its a bit more portable