refactored mean firing rate computation