Added logic to minimize re-compilation time