Shortened some redundant code.