A little refactoring, added minimizing code