Better logic

Signed-off-by: Suki <suki@missallsunday.com>
@todo theres a lot of ifs here... better split all cases into small methods

Signed-off-by: Suki <suki@missallsunday.com>