few lines removed because these methods are called from ios platform.