optimize code, enhance readability