Cleand up repeat code.