updated methods for easier testing