Added grunt and cleaned up the code