Adding aop logging and code refactor.