optimize code and rename class/variable