minimized the code