Reffactor to follow coding standards