Remove duplicated code
Make compiler updates more robust