[fx] wrap code within a singleton