Moved helpers to separate file.