Use slug lib
Separate command from lib