code refactor all over
added features to config pg