[WIP] Code improvements