Cleaned up redundent code