Polishing up the code