There are way too many if statements in run.go right now and its really hard to understand it. We need a bit of refactoring.