found a bit of duplicated code