added dependency import and refactored serializers to improve DRY