Migrate from xml configuration to java configuration