Yea probably. There is a lot of duplication in these functions would probably be good to refactor them further.