Code Refactor to make it more compatible to a posible merge in docker