WIP
fixed performance issues