Polished code a bit