optional https
updated configuration
refactoring
some improvements