simplifying the code and the dependency