refactor leap for better readability keeping concise implementation