revamp and improve, use JSON settings file