Working on options dialog + code cleanup.