refactor catalog info and add some SQL querys