Duplicate code.. Make a function.