Move dotenv method to library