Attempt to refactor
Fix the added bounty