Ok but could be cleaner