added type This and some other minor changes