add release and refactor slightly