Inlined the methods that are called only once.