use DI pattern for rails asset pipeline compatibility