Business logic for the cljs side (will need some tests :))