refactor leon, make it less complicated