Refactoring and fixed bug on compiler.c