refactored into factory that is loaded from classpath