Simplify getRandom
Clean up imports