improving performance + fixing compilation issues
5 files changed