Move exports object definition and get rid of unnecessary var
Removed dead code.