split implementation into smaller files