configuration refactor, add user tweaking, fix bug