Refactor to allow more secure configuration