Cleans-up duplicated code.