Re-factor the code based on code sniffer findings