Refactoring, add compile error detection on save