update: code organization, getDefaults method added for simplicity