removing redundent function+minor fixes