Improve usage of CDI