Make use of existing code, no need to re-write it every time

This will tidy this function up a little and remove repeated functionality, might as well make use of stuff you've already written