updated buildintermediate and starting to simplify the architecture and build the Security model