[IMP] Condense code and general clean up