Refactored with the correct file architecture