Remade into class, next rails and some js