#41 A slightly less complex and more flexible approach