REFAC: rebase code to master