Trying to reorganize the code using libraries