Type safety improvement