refactored for use with GraniteDS 3.0.0