Move check in function to seperate file