Moving configuration from xml to java