Some refactor in loops, if and VariableContainer.