dont use undefined as default values
go through some TODOs
change @type to @implements where needed