improved coding convention and refractored apropriately