condensed some method existence checking logic