Refactor. Starting on semantic analysis.