FIX: Made more generalized