Code cleanup (+minor perf improvement too most likely) by utilizing the new template functions in Scene and Entity.