Start sorting this mess.
Simplify.
Remove function repetition.
Mess sorted.