Removed some redundant code in solver