HR-255

Code Tweaks and periods fetch from db