Refactor: Moving out dplicated code into base class.