Refractored current code: 04-25-2014