fixes & improvements by janx review