Cleaned main code from bullshit