Cleaned up to speed up