refact + fix.