Refactored using modules