Fixed recursive flag
First code refactor