Automated layer calculations and clean ups