refactored this shiznizzls