Fixed refact bug