Separate files to clean the code, pass function as arguments to support easilly testing to differetn functions