Refactor to allow overriding the method for getting marked resources