cleaned main & methods