split code to libraries