refactored: created beacon.swift to encaplulate beacon