removed redunant returns, optimized validation use