improved compilation functions