new version with code refactoring