More code cleanup, shift globals to use keyword instead

Signed-off-by: Shitiz Garg <mail@dragooon.net>