added local keywords & other minor refactoring