Add loki_check function and move targets to common header