Sometimes I wish javascript had stricter checking
cleanup