Applied a refactored patch of FELIX-218 since the original patch was removed when merging the plugin with FELIX-199.