Feature/refactor leaves