refactor, no jquery dependency