cleaned up Core functions