Cleanup and added configurable security.