Refactoring the approach a bit