fix #298. Removing orphan code

A bit of cleaning and closing issues. #298