Refactored again, stack behavior and no more dependencies.