added security module and cleaned persistence module