Refactoring and added option for incomplete synthesis