Reduced memory usage and removed serveral files