getting rid of some repetitive code (forgot to add this to the last commit)