Put { in if
Move function to main file
remove unwanted filey