clarified package structure;
extract shared code