Refactored our tables and added state condition