extract methods for testibility