move calmap into libs