made some simplifications in code