Organize code and make secure