Made changes to do all the configuration in java itself