Added release support
Moved code around a bit