Some refactoring + findvalue issues fixed