Refactoring to be used inbigmler