Adapted features from original plugin