optimize timer and frame manager