optimized function to get important state