refactoring on indi code
more small fixes