Refactored into separate modules