[IMP]Improved code, optimized some code and removed redundant methods