Refactored persistence layer for better readability and list support.