Implemented the Security components and improved the structure