made better use of final and const (performance optimizations)