use intention revealing names
reduce cyclomatic complexity of foil solver
merge older code