Modify default configuration and refactor