Some cleanup and introduced parameter typehints